<template>
  <div id="app">
    <index-view />
  </div>
</template>

<script>
import IndexView from "../views/index/index.vue";
export default {
  name: "App",
  mounted() {
    document.addEventListener("DOMContentLoaded", (event) => {
      console.log("first contentful painting",event);
    });
    if (process.env.NODE_ENV === "development") {
      console.log("开发环境");
    } else {
      console.log("生产环境");
      document.addEventListener("contextmenu", this.preventContextMenu);
      document.onkeydown = function (e) {
        if (
          e.key === "F12" ||
          (e.ctrlKey && e.shiftKey && e.key === "I") ||
          (e.ctrlKey && e.key === "U")
        ) {
          // F12, Ctrl+Shift+I, Ctrl+U
          // alert("功能已被禁用！");
          e.preventDefault();
          return false;
        }
      };
    }
  },
  methods: {
    preventContextMenu(event) {
      event.preventDefault();
    },
  },
  components: {
    IndexView,
  },
};
</script>

<style scoped>
::v-deep .el-button--primary {
  color: #ffffff;
  background-color: #1968fa !important;
  border-color: #1968fa !important;
}
::v-deep .el-button--primary.is-plain {
  color: #409eff !important;
  background: #ecf5ff !important;
  border-color: #b3d8ff !important;
}
</style>
